package com.star.cat.persitent;

import java.net.InetAddress;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.env.Environment;

import lombok.extern.slf4j.Slf4j;
@Slf4j
@EnableAspectJAutoProxy
@SpringBootApplication
@EnableCatPersitent
public class PerApplication {

	public static void main(String[] args) throws Exception {
		ConfigurableApplicationContext application =SpringApplication.run(PerApplication.class, args);
		Environment env = application.getEnvironment();
		String ip = InetAddress.getLocalHost().getHostAddress();
		String port = env.getProperty("server.port");
		log.info("\n----------------------------------------------------------\n\t" +
				"Application Cat-Cache is running! Access URLs:\n\t" +
				"Cache: \t\thttp://" + ip + ":" + port + "/cache" + "/\n\t" +
				"Persitent: \thttp://" + ip + ":" + port + "/persitent" + "/\n" +
				"----------------------------------------------------------");
	}

}
